package libs

import (
	"github.com/gin-gonic/gin"
	"strconv"
)

func Page(c *gin.Context) int {
	page := c.DefaultQuery("page", "1")
	if page == "" {
		return 1
	}
	pageInt, err := strconv.Atoi(page)
	if err != nil {
		return 1
	}
	return pageInt
}
